In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
In [2]:
x = np.arange(-np.pi,np.pi,0.001)
plt.plot(x,np.sin(x))
Out[2]:
In [3]:
x = np.arange(-np.pi,np.pi,0.001)
plt.plot(x,np.sin(x))
plt.title('y = sin(x)')
Out[3]:
In [4]:
x = np.arange(-np.pi,np.pi,0.001)
plt.plot(x,np.sin(x))
plt.title(r'$y = \sin(x)$')
Out[4]:
In [5]:
x = np.arange(-np.pi,np.pi,0.001)
plt.plot(x,np.sin(x))
plt.title('y = sin(x)')
plt.xlabel('x (radians)')
plt.ylabel('y')
Out[5]:
In [6]:
x1 = np.linspace(0.0, 5.0)
x2 = np.linspace(0.0, 2.0)
y1 = np.cos(2 * np.pi * x1) * np.exp(-x1)
y2 = np.cos(2 * np.pi * x2)
plt.subplot(2, 1, 1)
plt.plot(x1, y1, 'o-')
plt.title('A tale of 2 subplots')
plt.ylabel('Damped oscillation')
plt.subplot(2, 1, 2)
plt.plot(x2, y2, '.-')
plt.xlabel('time (s)')
plt.ylabel('Undamped')
Out[6]:
In [ ]: